<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                template="./../template/WorkspaceTemplate.xhtml">

    <ui:define name="top">

    </ui:define>

    <ui:define name="left">

    </ui:define>

    <ui:define name="right">

    </ui:define>

    <ui:define name="content">
        <h:form id="RawMaterialPickingOrderForm" style="font-size: 85%">
            <h2>View Raw Material Picking Order</h2>
            <br/>
            <p:panel>
                <br/>
                <h:outputText value="Raw Material Picking Order" style="font-weight: bold; font-size: 110%"/>
                <p:separator/>
                <br/>
                <h:panelGrid columns="6" cellpadding="10" style="width:100%">
                    <h:outputLabel value ="Order ID" style="font-weight: bold"/>
                    <h:outputText value="#{lcManagerBean.pickingOrder.pickingOrderId}"/>
                    <h:outputText value=""/>
                    <h:outputText value=""/>
                    <h:outputLabel value ="Delivery Order ID" style="font-weight: bold"/>
                    <h:outputText value="#{lcManagerBean.pickingOrder.deliveryOrder.id}"/>

                    <h:outputLabel value ="Task Priority" style="font-weight: bold"/>
                    <h:outputText value="#{lcManagerBean.pickingOrder.deliveryOrder.priority}"/>
                    <h:outputText value=""/>
                    <h:outputText value=""/>
                    <h:outputLabel value ="Order Date" style="font-weight: bold"/>
                    <h:outputText value="#{lcManagerBean.pickingOrder.pickingOrderDate}"/>

                    <h:outputLabel value ="Order Status" style="font-weight: bold"/>
                    <h:outputText value="#{lcManagerBean.pickingOrder.status}"/>
                    <p:commandButton value ="Check Done" disabled="#{lcManagerBean.pickingOrder.status == 'Done'}" action="#{lcManagerBean.setPickingOrderDone()}" update="RawMaterialPickingOrderForm"/>
                </h:panelGrid>

                <br/>
                <br/>
                <br/>
                <h:outputText value="Logistic Item Line" style="font-weight: bold; font-size: 110%"/>
                <p:separator/>
                <br/>
                <p:dataTable var="rec" value="#{lcManagerBean.pickingOrder.logisticItemLines}" emptyMessage="No logistic item line found.">

                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="RawMaterial" />  
                        </f:facet>  
                        <h:outputText value="#{rec.product.productType}" />  
                    </p:column>

                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="Picking Quantity" />  
                        </f:facet>  
                        <h:outputText value="#{rec.pickingQty}" />  
                    </p:column>

                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="Location" />  
                        </f:facet>  
                        <h:outputText value="#{rec.shippingCase.location}" />  
                    </p:column>

                    <p:column>
                        <f:facet name="header">
                            <h:outputText value="Description" />  
                        </f:facet>  
                        <h:outputText value="#{rec.description}" />  
                    </p:column>

                </p:dataTable>
                <br/>

            </p:panel>
            <br/>
            <br/>
            <br/>
            <div align="right">
                <p:commandButton value="Back" image="ui-icon ui-icon-arrowreturnthick-1-w" action="#{lcManagerBean.viewOrderList()}"/>
            </div>
            <br/>
            <br/>
            <br/>
        </h:form>
    </ui:define>

    <ui:define name="bottom">

    </ui:define>

</ui:composition>
